package study.alibaba.sentinel.support;

import com.alibaba.csp.sentinel.init.InitExecutor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;

@Slf4j
@SpringBootApplication(scanBasePackages = "study.alibaba.sentinel")
public class SpringBootCfg {

//    @Value("${spring.application.name}")
//    private String projectName;
//    @Value("${sentinel.dashboard.server}")
//    private String server;
//
//    @PostConstruct
//    public void init() {
//        //连接到控制台，与 sentinel 控制台通信
//        System.setProperty("csp.sentinel.app.name", projectName);
//        System.setProperty("csp.sentinel.dashboard.server", server);
//        InitExecutor.doInit();
//        log.info("{}", projectName);
//        log.info("{}", server);
//        log.info(">>>>>>>>>> 连接 Dashboard");
//    }
}
